home *** CD-ROM | disk | FTP | other *** search
- Subject:
- Sent: 6/11/96 9:41 AM
- Received: 6/11/96 9:51 AM
- From: Henri Lamiraux, lamiraux@apple.com
- Reply-To: ODF Interest, ODF-Interest@CILabs.ORG
- To: OpenDoc Development Framework Discussion List, ODF-Interest@CILabs.
-
- Mary's answer came back to me with an error. So here it is.
-
-
- >>What is the proper way to read tab-delimited formatted text from the
- >>clipboard. I want to loop, reading up to the next tab or return and parsing
- >>the text.
-
- >>I have looked at FW_CString, which has methods for searching a character,
- >>and FW_CTextReader, which don't have such methods. I am not clear if I must
- >>use one or the other, or both.
-
- I would say use a TextReader if you want to examine every character and
- perhaps back up; otherwise just use FW_CString::FindCharacter.
-
- If you use a TextReader the code would look something like this:
- FW_CMemoryReader* reader = FW_NEW(FW_CMemoryReader, (bufferPtr,
- numberOfBytes));
- while (reader->GetPosition() < reader->GetByteCount())
- {
- FW_LChar ch = reader->GetCharacterAndAdvance();
- if (ch == chTab) ...
- }
-
- If the text is already in the form of an FW_CString, you can create a
- StringReader:
- FW_CStringReader* reader = FW_NEW(FW_CStringReader, (string));
- The loop would be the same as above.
-
- Mary Boetcher
- ODF Person
-
-
-
- ........................................................................
- Henri Lamiraux lamiraux@apple.com
- Apple Computer, Inc. OpenDoc(tm) Development Framework
- ........................................................................
-
-